<!doctype html>
<html>
<title>Welcome</title>
<head>
	<center><h2>Please enter your details in order to register</h2></center>	
</head>
	<body bgcolor="#B0E0E6">
		<script>
function validateForm(inputtxt, minlength, maxlength) {
	var a = document.forms["form1"]["Username"].value;
	var specialchar = "!@#$%^&*()+=[]\';,./{}|:<>?~";
		if (a == null || a == "") 
				{	alert("You must enter Username");	return false;	}
		if (a.length < 3 || a.length > 10)
				{ alert("Enter username between 3 and 10 characters.");	return false;	}
		if (/^[a-zA-Z0-9-_]*$/.test(a) == false)
				{	alert('Username Contains special Characters!');		}
	var b = document.forms["form1"]["Password"].value;
		if (b== null || b== "") 
				{	alert("You must enter Password");	return false;	}
		if (/^(?=.*\d)(?=.*[a-zA-Z])(?!.*[\W_\x7B-\xFF]).{2,}$/.test(b) == false )
				{	alert("Password must contain at least one letter and one number!");		return false;	} 
	var c = document.forms["form1"]["Password1"].value;
		if (c != b)
				{	alert("Passwords do not match"); return false;	}
	var d = document.forms["form1"]["email"].value;
	var atpos = d.indexOf("@");
	var lastatpos = d.lastIndexOf("@");
	var dotpos = d.lastIndexOf(".");
	var dotpos1 = d.indexOf(".");
	var dashpos = d.indexOf("-");
		if (atpos< 1 || dotpos<atpos+2 || dotpos+2>=d.length || dotpos1<2 || dashpos==atpos+1 || lastatpos > dotpos || lastatpos != atpos || /^[a-zA-Z0-9-_@.]*$/.test(d) == false) 
				{	alert("Please enter a valid E-mail address");	return false;	}
	var e = document.forms["form1"]["FirstName"].value;
		if (e== null || e== "") 
				{	alert("You must enter Your name");	return false;	}
		if (/^[a-zA-Z]*$/.test(e) == false)
				{	alert('FirstName Contains special Characters!');	return false;	}
	var f = document.forms["form1"]["LastName"].value;
		if (f== null || f== "") 
				{	alert("You must enter Your name");	return false;	}
		if (/^[a-zA-Z]*$/.test(f) == false)
				{	alert('Last Name Contains special Characters!');	return false;	}	return true;	}
	</script>
<fieldset>
	<form name="form1" onsubmit="return validateForm()"  method="get" action="congrat.html">
	
			<label>Username: </label>
			<center>
				<input type="text" id=Username name=Username maxlength="10" placeholder="Input Username">
			</center>
			
			<label>Password: </label>
			<center>
				<input type="password" name=Password placeholder="Input Password">
			</center>
			
			<label>Re-type Password: </label>
			<center>
				<input type="password" name=Password1 placeholder="Confirm Password">
			</center>
			
			<label>Email address: </label>
			<center>
				<input type="email" name=email  placeholder="Input your e-mail">
			</center>
			
			<label>First name: </label>
			<center>
				<input type="text" name=FirstName placeholder="Input your name">
			</center>
			
			<label><del>First</del> <b><ins>Last</ins> Name </label></b>
			<center>
				<input type="text" name=LastName placeholder="Input your last name">
			</center>
			
					<form action="demo_form.asp">
							<label for="male">Male</label>
							<input type="radio" name="sex" id="male" value="male"><br>
							<label for="female">Female</label>
							<input type="radio" name="sex" id="female" value="female"><br>
							<label for="Camel">Sometimes Camel</label>
							<input type="radio" name="sex" id="Camel" value="Camel"<br>	<br>		
			<input type="submit" value="Register">
			</form>
</fieldset>
</form>
 <footer>
 <hr>
  <p>Posted by: Rado Rado<del><img src="stickman.gif" width="24" height="39" alt="Stickman"></del></p>
  <p>Contact information: <a href="Rado@Rado.com">
  Rado@Rado.com</a>.</p>
</footer> 
</body>
</html>